package net.pws.oos.biz.service;

import java.util.List;
import java.util.Map;

import net.pws.common.security.spi.resource.Resource;
import net.pws.oos.biz.model.OperateLog;
import net.pws.oos.biz.model.Organization;
import net.pws.oos.biz.model.Role;
import net.pws.oos.biz.model.User;

/**
 * 
 *
 */
@SuppressWarnings("rawtypes")
public interface SystemManageService {
    
    /**
     * @param user
     * @return
     */
    public User saveUser(User user);
    
    /**
     * @param id
     */
    public void deleteUser(String id);
    
    /**
     * @param userId
     * @param newPassword
     */
    public void changeUserPassword(String userId, String newPassword);
    
    /**
     * @param userId
     * @param oldPassword
     * @param newPassword
     */
    public void changeUserPassword(String userId,
                                   String oldPassword,
                                   String newPassword);
    
    /**
     * @param userId
     * @param roleIds
     */
    public void bindUserRole(String userId, String[] roleIds);
    
    /**
     * @param userId
     * @param roleIds
     */
    public void unbindUserRole(String userId, String[] roleIds);
    
    /**
     * @param roleId
     * @param userIds
     */
    public void bindRoleUser(String roleId, String[] userIds);
    
    /**
     * @param roleId
     * @param userIds
     */
    public void unbindRoleUser(String roleId, String[] userIds);
    
    /**
     * @param role
     * @return
     */
    public Role saveRole(Role role);
    
    /**
     * @param id
     */
    public void deleteRole(String id);
    
    /**
     * @param ids
     */
    public void deleteRole(String[] ids);
    
    /**
     * @param organization
     * @return
     */
    public Organization saveOrganization(Organization organization);
    
    /**
     * @param id
     */
    public void deleteOrganization(String id);
    
    /**
     * @return
     */
    public int getResourceCount();
    
    /**
     * @param id
     * @return
     */
    public Resource getResource(String id);
    
    /**
     * @param id
     * @return
     */
    public List<Resource> getResourceChildren(String id);
    
    /**
     * @param queryParameter
     * @param start
     * @param limit
     * @return
     */
    public List<Resource> getResourceList();
    
    /**
     * @param id
     * @param roleId
     * @return
     */
    public List<Map> getMenuPermissionChildren(String id, String roleId);
    
    /**
     * 获得菜单及操作的权限子列表
     * @param id
     * @param roleId
     * @return
     */
	public List<Map> getMenuOperationPermissionChildren(String id, String roleId);

    
    /**
     * @param roleId
     * @param menuPermission
     * @return
     */
    public List saveMenuPermission(String roleId, List menuPermission);
    
    public void saveOperateLog(OperateLog operateLog);
    
}
